<template>
	<view class="content">
		<view class="list">
			<view class="card" v-for="(item,index) in list" :key="index" @click="godetial">
				<view class="pic">
					<img :src="item.prizesImage" alt="">
				</view>
				<view class="name">奖品：{{item.prizesName}}</view>
				<view class="other">
					<view class="name"></view>
					<view class="btn">等待开奖</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				navId: 0,
				list: [],
			}
		},
		onShow() {
			this.getlist(0)
		},
		onLoad() {

		},
		methods: {

			getlist(id) {
				this.$api.request({
					url: this.$api.getmyprizelist
				}).then((res) => {
					this.list = res.rows
					console.log(this.list);
				})
			},
			
			godetial(){
				uni.navigateTo({
					url:'/pages/prize_com/components/prizedetial'
				})
			}

		},
	}
</script>

<style lang="less" scoped>
	.content {
		width: 100vw;
		height: 90vh;
		padding: 5vh 0;
		background: linear-gradient(to bottom, red, orange);

		.list {
			width: 94%;
			height: 90vh;
			margin: 0 auto;
			overflow: scroll;
			border-radius: 30rpx;

			.card {
				margin: 30rpx 0;
				width: 100%;
				height: 40vh;
				background-color: #fff;
				border-radius: 30rpx;
				overflow: hidden;

				.pic {
					width: 100%;
					height: 25vh;

					img {
						padding: 2%;
						width: 96%;
						height: 96%;
					}
				}

				.name {
					width: 94%;
					padding: 0 3%;
					height: 8vh;
					line-height: 8vh;
					font-size: 36rpx;
				}

				.other {
					width: 100%;
					height: 7vh;
					display: flex;
					flex-direction: row;
					justify-content: space-between;

					.name {
						flex: 1;
						width: 50%;
						height: 7vh;
						line-height: 7vh;
						font-size: 30rpx;
					}

					.btn {
						width: 26%;
						height: 5vh;
						margin: 1vh auto;
						line-height: 5vh;
						text-align: center;
						background-color: red;
						border-radius: 2vh 0 0 2vh;
						color: #fff;
					}
				}
			}
		}

		.list::-webkit-scrollbar {
			display: none;
			/* 隐藏滚动条 */
		}
	}
</style>